﻿namespace Utils
{
    public class EnumService
    {
        public static string GeneralTestResultToDomainModelValue(string? result)
        {
            switch (result ?? "")
            {
                case "OK":
                    return "1";
                case "NG":
                    return "2";
            }
            return "3";
        }
        public static string GeneralTestResultToDataModelValue(string? result)
        {
            switch (result ?? "")
            {
                case "1":
                    return "OK";
                case "2":
                    return "NG";
            }
            return "NA";
        }
        public static string GeneralProduceModeToDomainModelValue(string? result)
        {
            switch (result ?? "")
            {
                case "正常生产":
                    return "1";
                case "返检模式":
                    return "2";
                case "点检模式":
                    return "3";
                case "强制排料":
                    return "4";
            }
            return "1";
        }
        public static string GeneralProduceModeToDataModelValue(string? result)
        {
            switch (result ?? "")
            {
                case "1":
                    return "正常生产";
                case "2":
                    return "返检模式";
                case "3":
                    return "点检模式";
                case "4":
                    return "强制排料";
            }
            return "NA";
        }
        public static string HanJieTestResultToDomainModelValue(string? result)
        {
            switch (result ?? "")
            {
                case "Good":
                    return "1";
                case "Suspect":
                    return "2";
                case "Bad":
                    return "3";
            }
            return "NA";
        }
        public static string HanJieTestResultToDataModelValue(string? result)
        {
            switch (result ?? "")
            {
                case "1":
                    return "Good";
                case "2":
                    return "Suspect";
                case "3":
                    return "Bad";
            }
            return "NA";
        }
        public static string PointCheckTestResultToDataModelValue(string? result)
        {
            switch (result ?? "")
            {
                case "0":
                    return "NA";
                case "1":
                    return "PASS";
                case "2":
                    return "NG";
            }
            return "3";
        }
    }
}
